<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        a {
            text-decoration: none;
        }

        .btn {
            font-size: 18px;
            padding-top: 10px;
            padding-bottom: 10px;
            padding-left: 20px;
            padding-right: 20px;
            color: #f6f6f6;
            border-radius: 5px;
            border-width: 0px;
            cursor: pointer;
        }

        .btn-danger {
            background-color: red;
        }

        .btn-sucess {
            background-color: #00FFCC;
        }

        .btn-info {
            background-color: dodgerblue;
        }
        .show {
            display: block;
        }
        .hidden{
            display: none;
        }
    </style>
</head>

<body>
    <!-- 当点击显示按钮 显示content内容 -->
    <!-- 当点击隐藏按钮 隐藏content内容 -->
    <!-- 当点击关闭按钮 关闭当前页面窗口 -->
    <input type="button" value="显示" class="btn btn-sucess" id="show">
    <hr>
    <button class="btn btn-danger" id="hidden">隐藏</button>
    <hr>
    <a href="" class="btn btn-info" id="close">关闭</a>
    <hr>
    <div class="content hidden">
        <p>我显示文字</p>
        <img src="https://y.gtimg.cn/music/photo_new/T002R300x300M000000EI9tu27e5iy_1.jpg?max_age=2592000" alt="">
    </div>
    <script>
        // 点击 需要对元素绑定事件
        // 1、查找元素
        var btn_show = document.querySelector('#show')
        var btn_hidden = document.querySelector('#hidden')
        var btn_close = document.querySelector('#close')
        var content = document.querySelector('.content')
        // 2、绑定事件  
        btn_show.onclick = function () {
            // 3、做对应操作
            content.className = 'show' 
            // content.style.display = 'block'
        }
        btn_hidden.onclick = function(){
            // content.style.display = 'none'
            content.className = 'hidden'
        }
        btn_close.onclick = function(){
            //关闭当前窗口 BOM对象  
            window.close()
        }

    </script>
</body>

</html>